#-*- coding: utf-8 -*-
from django.shortcuts import render
from BPCreator.forms import bp_form
from BPCreator.models import BPO


def BPCreator(request):
    
    form = bp_form()
#     if request.method == 'POST':
#         bptypeid = request.POST.__getitem__('bptypeid')      
#         bpname = Invblueprinttypes.objects.get(blueprinttypeid=bptypeid).producttypeid.typename
#         request.session['BPC_bpname'] = bpname
    list_blueprint = list_bp()
    return render(request, 'BPCreator.html', locals())

def list_bp():
    temp = []
    try:
        list_bp = BPO.objects.all()
    except:
        list_bp = []
    return list_bp